void ClockMode1() {

  //Clock mode 1
  //2 leds for hours 1 led for minutes and 1 led for seconds

  //Hours
  //Turn on hour LEDs 1st row
  lc1.setLed(0,Pos1A[hours*5],Pos1B[hours*5],true);
  //Turn off previous hour LEDs at next hour
  lc1.setLed(0,Pos1A[(hours*5)-5],Pos1B[(hours*5)-5],false);

  //Turn off previous hour led if hour = 0
  if(hours == 0) {lc1.setLed(0,0,3,false);}

  //Turn on hour LEDs 2nd row
  lc1.setLed(1,Pos2A[hours],Pos2B[hours],true);
  //Turn off previous lit hour LEDs at next hour
  lc1.setLed(1,Pos2A[hours-1],Pos2B[hours-1],false);
  //Turn of previous hour led2 if hour = 0
  if(hours == 0) {lc1.setLed(1,0,2,false);}

  //Minutes
  //Turn on Minute LED
  lc1.setLed(0,Pos1A[minute],Pos1B[minute],true);
  //Turn off previous minute LED at next minute
  lc1.setLed(0,Pos1A[minute-1],Pos1B[minute-1],false);

  if(minute == 0) {lc1.setLed(0,7,7,false);}

  //Seconds
  lc1.setLed(0,Pos1A[second],Pos1B[second],true);
  //Turn off previous second LED at next second
  lc1.setLed(0,Pos1A[second-1],Pos1B[second-1],false); 

  if(second == 0) {lc1.setLed(0,7,7,false);}

}

void ClockMode2() {
  
  //Clock mode 2
  //2 leds for hours all leds turn on for minutes
  //Hours
  //Turn on hour LEDs 1st row
  lc1.setLed(0,Pos1A[hours*5],Pos1B[hours*5],true);

  //turn on hour LEDs 2nd row
  lc1.setLed(1,Pos2A[hours],Pos2B[hours],true);

  //turn off previous lit hour LEDs at next hour
  lc1.setLed(1,Pos2A[hours-1],Pos2B[hours-1],false);

  //turn of previous hour led2 if hour = 0
  if(hours == 0) {lc1.setLed(1,0,2,false);}

  //Turn off previous hour LEDs at next hour
  if(currenthour<hours){
    
    lc1.setLed(0,Pos1A[(hours*5)-5],Pos1B[(hours*5)-5],false);
    currenthour++;
    
  }

  //Turn of previous hour led if hour = 0 
  //Hourstate prevents blinking of hour 11 led because of continious turning on and off
  if(hours == 0 & hourstate==0) {
    
     lc1.setLed(0,0,3,false);
     hourstate=1;
   
   }

  if(hours>0) {hourstate=0;}
  if(hours==0) {currenthour=0;}


  //Minutes
  //turn on Minute LED

  for (int minuteled=0; minuteled<=minute; minuteled++) {
    
        lc1.setLed(0,Pos1A[minuteled],Pos1B[minuteled],true);
  }

  //turn off all minute leds if minute is 0
  if(minute>=1) {minutestate=0;}
     
  if(minute==0 & minutestate == 0) {
    
      for (int minuteled=59; minuteled >=0; minuteled--){
    
          //Minutestate prevents running this loop for one minute
          minutestate=1;
          delay(20);
          lc1.setLed(0,Pos1A[minuteled],Pos1B[minuteled],false);
      }
   
  }

}

